package com.designpatterns.behavioral.adapter;

public class PoliceCarAdapter extends CarController {

    private PoliceLamp policeLamp;
    private PoliceSound policeSound;

    public PoliceCarAdapter() {
        this.policeLamp = new PoliceLamp();
        this.policeSound = new PoliceSound();
    }

    //发出警笛声音
    @Override
    public void phonate() {
        policeSound.alarmSound();
    }

    //呈现警灯闪烁
    @Override
    public void twinkle() {
        policeLamp.alarmLamp();
    }
}
